<?php

namespace hichefu;

/**
 * error code 说明.
 * <ul>
 *    <li>200: 调⽤成功，⽆错误</li>
 *    <li>10000: 业务错误，具体⻅msg</li>
 *    <li>10101: ⽆效的API请求，如请求⽅式不对、api名称不对</li>
 *    <li>10102: 缺失token</li>
 *    <li>10103: token错误或已失效</li>
 *    <li>10104: 签名错误</li>
 *    <li>10105: 时间差异⼤，拒绝访问</li>
 *    <li>10106: AppId错误或失效</li>
 *    <li>10107: AppKey错误或失效</li>
 *    <li>10108: 访问过于频繁，请稍后再试</li>
 *    <li>10200: 必填参数缺失</li>
 *    <li>10201: 参数类型错误</li>
 *    <li>10999: 未知错误</li>
 * </ul>
 */
class ErrorCode
{

    public static $OK = 200;
    public static $Error10000 = 10000;
    public static $Error10101 = 10101;
    public static $Error10102 = 10102;
    public static $Error10103 = 10103;
    public static $Error10104 = 10104;
    public static $Error10105 = 10105;
    public static $Error10106 = 10106;
    public static $Error10107 = 10107;
    public static $Error10108 = 10108;
    public static $Error10200 = 10200;
    public static $Error10201 = 10201;
    public static $Error10999 = 10999;

    public static function code_list()
    {
        return [
            self::$OK => '调⽤成功，⽆错误',
            self::$Error10000 => '业务错误，具体⻅msg',
            self::$Error10101 => '⽆效的API请求，如请求⽅式不对、api名称不对',
            self::$Error10102 => '缺失token',
            self::$Error10103 => 'token错误或已失效',
            self::$Error10104 => '签名错误',
            self::$Error10105 => '时间差异⼤，拒绝访问',
            self::$Error10106 => 'AppId错误或失效',
            self::$Error10107 => 'AppKey错误或失效',
            self::$Error10108 => '访问过于频繁，请稍后再试',
            self::$Error10200 => '必填参数缺失',
            self::$Error10201 => '参数类型错误',
            self::$Error10999 => '未知错误',
        ];
    }

}
